Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
Next JS "revalidate" does not "revalidate"

My code on the dev server

function Home(props) {
  console.log("Hello")
  return (
    <ul>
      {props.user.map((user) => (
        <li key={user.id}>{user.email}</li>
      ))}
    </ul>
  )
}

export default Home

export async function getStaticProps() {
  const res = await fetch('https://jsonplaceholder.typicode.com/users')
  const data = await res.json()

  return {
    props: {
      user: data,
    },
    revalidate: 10,
  }
}

Then I run npm run build and start the real server with npm run start

Now if I change my JSX from

<li key={user.id}>{user.email}</li>

to

<li key={user.id}>{user.username}</li>

And wait some time, then the page still looks like before, nothing has changed -> It still shows user.email and not user.username

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You have to reload you page to see your changes , Because Next js caches HTML on the server and won't show the fresh data to the user as soon as it updates .

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!